/*
 * Chess.h
 *
 *  Created on: 2012-8-16
 *      Author: zhangchao
 */

#ifndef CHESS_H_
#define CHESS_H_

#include<Common.h>

/*
 typedef enum ChessType{
 bin,
 pao,
 ju,
 ma,
 xiang,
 shi,
 shuai
 };

 typedef struct Chess{
 int xIndex;
 int yIndex;
 enum ChessType type;
 int arrayIndex;
 };

 struct Chess *Chesses[32];
 */

/* 第1位：0 己方 1 敌方 第2，3，4位：棋子类型
 *  0 bin, 1 pao, 2 ju, 3 ma,4 xiang,5 shi,6 shuai */
unsigned char board[9][10];

char OWN_SIDE=0;
char COMP_SIDE=1;

char CHESS_BIN = 0;
char CHESS_PAO = 1;
char CHESS_JU = 2;
char CHESS_MA = 3;
char CHESS_XIANG = 4;
char CHESS_SHI = 5;
char CHESS_SHUAI = 6;

char COMPETITOR_START = 128;

int INDEX_X_MAX = 8;

int INDEX_Y_MAX = 9;

char mkChessByParam(char side,char type);

bool isOwnChess(char chess);

void getChessTypeAndSide(char chess,char *type,char *side);

#endif /* CHESS_H_ */
